C (75/254)

From:Colin Wenzel
Date:20 Apr 00 at 13:44:45
Subject:Re: How to change stack

On 20-Apr-00, Allan Odgaard wrote:
> On 20-Apr-00, Andrzej J. Debicki wrote:
>> Thanks. I wrote some test proggy. But something id wrong. It hangs
>> on first StackSwap func. Can someone help me to solve that?
>
>> #include <exec/memory.h>
>> #include <exec/types.h>
>> #include <clib/alib_protos.h>
>
> I haven't got time to investigate it further right now, but try to
> include 'proto/exec.h' -- without it the compiler will generate an
> external reference for the symbol StackSwap(). The stub function is
> present in amiga.lib and later linked to your library, but this
> scheme doesn't work, because you can't return from a function (stub)
> without first changing back the stack, as that's where the return
> address is found. By including the pragmas the compiler will know
> it's a lib function and should do the library call inline...
> Regards Allan

I fixed it !!

The amiga.lib stub for StackSwap() is faulty.

This works:

...................

xref _SysBase
public _StackSwap

_StackSwap
move.l 4(sp),a0
move.l (_SysBase),a6
JMP _LVOStackSwap(A6)

..................

It isn't, it is passing the wrong number & wrong argument......

-------------------------------------
Colin Wenzel. Australia.

EMAIL: mailto:colstv@hotkey.net.au
URL: http://www.hotkey.net.au/~colstv/
ICQ: 17608330
AMIGA: 4000T, 68060/50, 150Mb RAM,
OS 3.5, EGS Spectrum.
---------------------------------------

------------------------------------------------------------------------
IT Professionals: Match your unique skills with the best IT projects at
http://click.egroups.com/1/3381/1/_/451227/_/956234837/
------------------------------------------------------------------------